home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacMemory.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  33.6 KB  |  1,408 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacMemory.a
  3. ;
  4. ;    Contains:    Memory Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACMEMORY__') = 'UNDEFINED' THEN
  19. __MACMEMORY__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.  
  28.  
  29.  
  30. maxSize                            EQU        $00800000            ;Max data block size is 8 megabytes
  31.  
  32. defaultPhysicalEntryCount        EQU        8
  33.  
  34.                                                             ; values returned from the GetPageState function 
  35. kPageInMemory                    EQU        0
  36. kPageOnDisk                        EQU        1
  37. kNotPaged                        EQU        2
  38.  
  39.                                                             ; masks for Zone->heapType field 
  40. k32BitHeap                        EQU        1                    ; valid in all Memory Managers 
  41. kNewStyleHeap                    EQU        2                    ; true if new Heap Manager is present 
  42. kNewDebugHeap                    EQU        4                    ; true if new Heap Manager is running in debug mode on this heap 
  43. ;  Note: The type "Size" moved to Types.h 
  44.  
  45.  
  46. Zone                    RECORD 0
  47. bkLim                     ds.l    1                ; offset: $0 (0)
  48. purgePtr                 ds.l    1                ; offset: $4 (4)
  49. hFstFree                 ds.l    1                ; offset: $8 (8)
  50. zcbFree                     ds.l    1                ; offset: $C (12)
  51. gzProc                     ds.l    1                ; offset: $10 (16)
  52. moreMast                 ds.w    1                ; offset: $14 (20)
  53. flags                     ds.w    1                ; offset: $16 (22)
  54. cntRel                     ds.w    1                ; offset: $18 (24)
  55. maxRel                     ds.w    1                ; offset: $1A (26)
  56. cntNRel                     ds.w    1                ; offset: $1C (28)
  57. heapType                 ds.b    1                ; offset: $1E (30)        ;  previously "maxNRel", now holds flags (e.g. k32BitHeap)
  58. unused                     ds.b    1                ; offset: $1F (31)
  59. cntEmpty                 ds.w    1                ; offset: $20 (32)
  60. cntHandles                 ds.w    1                ; offset: $22 (34)
  61. minCBFree                 ds.l    1                ; offset: $24 (36)
  62. purgeProc                 ds.l    1                ; offset: $28 (40)
  63. sparePtr                 ds.l    1                ; offset: $2C (44)
  64. allocPtr                 ds.l    1                ; offset: $30 (48)
  65. heapData                 ds.w    1                ; offset: $34 (52)
  66. sizeof                     EQU *                    ; size:   $36 (54)
  67.                         ENDR
  68. ; typedef struct Zone *                    THz
  69.  
  70. MemoryBlock                RECORD 0
  71. address                     ds.l    1                ; offset: $0 (0)
  72. count                     ds.l    1                ; offset: $4 (4)
  73. sizeof                     EQU *                    ; size:   $8 (8)
  74.                         ENDR
  75. LogicalToPhysicalTable    RECORD 0
  76. logical                     ds        MemoryBlock        ; offset: $0 (0)
  77. physical                 ds.b    8 * MemoryBlock.sizeof ; offset: $8 (8)
  78. sizeof                     EQU *                    ; size:   $48 (72)
  79.                         ENDR
  80. ; typedef short                         PageState
  81.  
  82. ; typedef short                         StatusRegisterContents
  83.  
  84.  
  85.  
  86. ;
  87. ; pascal Ptr GetApplLimit(void)
  88. ;
  89.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  90.         Macro
  91.         _GetApplLimit         &dest=(sp)
  92.             move.l            $0130,&dest
  93.         EndM
  94.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  95.         IMPORT_CFM_FUNCTION GetApplLimit
  96.     ENDIF
  97.  
  98. ;
  99. ; pascal THz SystemZone(void)
  100. ;
  101.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  102.         Macro
  103.         _SystemZone           &dest=(sp)
  104.             move.l            $02A6,&dest
  105.         EndM
  106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  107.         IMPORT_CFM_FUNCTION SystemZone
  108.     ENDIF
  109.  
  110. ;
  111. ; pascal THz ApplicationZone(void)
  112. ;
  113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  114.         Macro
  115.         _ApplicationZone      &dest=(sp)
  116.             move.l            $02AA,&dest
  117.         EndM
  118.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  119.         IMPORT_CFM_FUNCTION ApplicationZone
  120.     ENDIF
  121.  
  122. ;
  123. ; pascal Handle GZSaveHnd(void)
  124. ;
  125.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  126.         Macro
  127.         _GZSaveHnd            &dest=(sp)
  128.             move.l            $0328,&dest
  129.         EndM
  130.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  131.         IMPORT_CFM_FUNCTION GZSaveHnd
  132.     ENDIF
  133.  
  134. ;
  135. ; pascal Ptr TopMem(void)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _TopMem               &dest=(sp)
  140.             move.l            $0108,&dest
  141.         EndM
  142.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  143.         IMPORT_CFM_FUNCTION TopMem
  144.     ENDIF
  145.  
  146. ;
  147. ; pascal OSErr MemError(void)
  148. ;
  149.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  150.         Macro
  151.         _MemError             &dest=(sp)
  152.             move.w            $0220,&dest
  153.         EndM
  154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION MemError
  156.     ENDIF
  157.  
  158.  
  159.  
  160. ;
  161. ; pascal THz GetZone(void )
  162. ;
  163.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  164.         ; returns:
  165.         ;    THz             <= A0
  166.         _GetZone:    OPWORD    $A11A
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION GetZone
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal Handle NewHandle(Size byteCount)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         ; parameters:
  176.         ;    byteCount       => D0
  177.         ; returns:
  178.         ;    Handle          <= A0
  179.         _NewHandle:    OPWORD    $A122
  180.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  181.         IMPORT_CFM_FUNCTION NewHandle
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal Handle NewHandleSys(Size byteCount)
  186. ;
  187.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  188.         ; parameters:
  189.         ;    byteCount       => D0
  190.         ; returns:
  191.         ;    Handle          <= A0
  192.         _NewHandleSys:    OPWORD    $A522
  193.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  194.         IMPORT_CFM_FUNCTION NewHandleSys
  195.     ENDIF
  196.  
  197. ;
  198. ; pascal Handle NewHandleClear(Size byteCount)
  199. ;
  200.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  201.         ; parameters:
  202.         ;    byteCount       => D0
  203.         ; returns:
  204.         ;    Handle          <= A0
  205.         _NewHandleClear:    OPWORD    $A322
  206.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  207.         IMPORT_CFM_FUNCTION NewHandleClear
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal Handle NewHandleSysClear(Size byteCount)
  212. ;
  213.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  214.         ; parameters:
  215.         ;    byteCount       => D0
  216.         ; returns:
  217.         ;    Handle          <= A0
  218.         _NewHandleSysClear:    OPWORD    $A722
  219.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION NewHandleSysClear
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal THz HandleZone(Handle h)
  225. ;
  226.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  227.         ; parameters:
  228.         ;    h               => A0
  229.         ; returns:
  230.         ;    THz             <= A0
  231.         _HandleZone:    OPWORD    $A126
  232.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION HandleZone
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal Handle RecoverHandle(Ptr p)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  240.         ; parameters:
  241.         ;    p               => A0
  242.         ; returns:
  243.         ;    Handle          <= A0
  244.         _RecoverHandle:    OPWORD    $A128
  245.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION RecoverHandle
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal Handle RecoverHandleSys(Ptr p)
  251. ;
  252.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  253.         ; parameters:
  254.         ;    p               => A0
  255.         ; returns:
  256.         ;    Handle          <= A0
  257.         _RecoverHandleSys:    OPWORD    $A528
  258.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  259.         IMPORT_CFM_FUNCTION RecoverHandleSys
  260.     ENDIF
  261.  
  262. ;
  263. ; pascal Ptr NewPtr(Size byteCount)
  264. ;
  265.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  266.         ; parameters:
  267.         ;    byteCount       => D0
  268.         ; returns:
  269.         ;    Ptr             <= A0
  270.         _NewPtr:    OPWORD    $A11E
  271.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION NewPtr
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal Ptr NewPtrSys(Size byteCount)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  279.         ; parameters:
  280.         ;    byteCount       => D0
  281.         ; returns:
  282.         ;    Ptr             <= A0
  283.         _NewPtrSys:    OPWORD    $A51E
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION NewPtrSys
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal Ptr NewPtrClear(Size byteCount)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         ; parameters:
  293.         ;    byteCount       => D0
  294.         ; returns:
  295.         ;    Ptr             <= A0
  296.         _NewPtrClear:    OPWORD    $A31E
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION NewPtrClear
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal Ptr NewPtrSysClear(Size byteCount)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  305.         ; parameters:
  306.         ;    byteCount       => D0
  307.         ; returns:
  308.         ;    Ptr             <= A0
  309.         _NewPtrSysClear:    OPWORD    $A71E
  310.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION NewPtrSysClear
  312.     ENDIF
  313.  
  314. ;
  315. ; pascal THz PtrZone(Ptr p)
  316. ;
  317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  318.         ; parameters:
  319.         ;    p               => A0
  320.         ; returns:
  321.         ;    THz             <= A0
  322.         _PtrZone:    OPWORD    $A148
  323.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  324.         IMPORT_CFM_FUNCTION PtrZone
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal long MaxBlock(void )
  329. ;
  330.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  331.         ; returns:
  332.         ;    long            <= D0
  333.         _MaxBlock:    OPWORD    $A061
  334.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  335.         IMPORT_CFM_FUNCTION MaxBlock
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal long MaxBlockSys(void )
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  342.         ; returns:
  343.         ;    long            <= D0
  344.         _MaxBlockSys:    OPWORD    $A461
  345.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  346.         IMPORT_CFM_FUNCTION MaxBlockSys
  347.     ENDIF
  348.  
  349. ;
  350. ; pascal long StackSpace(void )
  351. ;
  352.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  353.         ; returns:
  354.         ;    long            <= D0
  355.         _StackSpace:    OPWORD    $A065
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION StackSpace
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal Handle NewEmptyHandle(void )
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         ; returns:
  365.         ;    Handle          <= A0
  366.         _NewEmptyHandle:    OPWORD    $A166
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION NewEmptyHandle
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal Handle NewEmptyHandleSys(void )
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         ; returns:
  376.         ;    Handle          <= A0
  377.         _NewEmptyHandleSys:    OPWORD    $A566
  378.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION NewEmptyHandleSys
  380.     ENDIF
  381.  
  382. ;
  383. ; pascal void HLock(Handle h)
  384. ;
  385.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  386.         ; parameters:
  387.         ;    h               => A0
  388.         _HLock:    OPWORD    $A029
  389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION HLock
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal void HUnlock(Handle h)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  397.         ; parameters:
  398.         ;    h               => A0
  399.         _HUnlock:    OPWORD    $A02A
  400.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION HUnlock
  402.     ENDIF
  403.  
  404. ;
  405. ; pascal void HPurge(Handle h)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  408.         ; parameters:
  409.         ;    h               => A0
  410.         _HPurge:    OPWORD    $A049
  411.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  412.         IMPORT_CFM_FUNCTION HPurge
  413.     ENDIF
  414.  
  415. ;
  416. ; pascal void HNoPurge(Handle h)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  419.         ; parameters:
  420.         ;    h               => A0
  421.         _HNoPurge:    OPWORD    $A04A
  422.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION HNoPurge
  424.     ENDIF
  425.  
  426. ;
  427. ; pascal void HLockHi(Handle h)
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  430.         ; parameters:
  431.         ;    h               => A0
  432.         Macro
  433.         _HLockHi
  434.             dc.w                $A064
  435.             dc.w                $A029
  436.         EndM
  437.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  438.         IMPORT_CFM_FUNCTION HLockHi
  439.     ENDIF
  440.  
  441. ;
  442. ; pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
  443. ;
  444.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  445.         Macro
  446.         _TempNewHandle
  447.             move.w              #$001D,-(sp)
  448.             dc.w                $A88F
  449.         EndM
  450.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  451.         IMPORT_CFM_FUNCTION TempNewHandle
  452.     ENDIF
  453.  
  454. ;
  455. ; pascal Size TempMaxMem(Size *grow)
  456. ;
  457.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  458.         Macro
  459.         _TempMaxMem
  460.             move.w              #$0015,-(sp)
  461.             dc.w                $A88F
  462.         EndM
  463.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  464.         IMPORT_CFM_FUNCTION TempMaxMem
  465.     ENDIF
  466.  
  467. ;
  468. ; pascal long TempFreeMem(void )
  469. ;
  470.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  471.         Macro
  472.         _TempFreeMem
  473.             move.w              #$0018,-(sp)
  474.             dc.w                $A88F
  475.         EndM
  476.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  477.         IMPORT_CFM_FUNCTION TempFreeMem
  478.     ENDIF
  479.  
  480. ;
  481. ; pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr)
  482. ;
  483.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  484.         _InitZone:    OPWORD    $A019
  485.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  486.         IMPORT_CFM_FUNCTION InitZone
  487.     ENDIF
  488.  
  489. ;
  490. ; pascal void SetZone(THz hz)
  491. ;
  492.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  493.         ; parameters:
  494.         ;    hz              => A0
  495.         _SetZone:    OPWORD    $A01B
  496.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  497.         IMPORT_CFM_FUNCTION SetZone
  498.     ENDIF
  499.  
  500. ;
  501. ; pascal Size CompactMem(Size cbNeeded)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  504.         ; parameters:
  505.         ;    cbNeeded        => D0
  506.         ; returns:
  507.         ;    Size            <= D0
  508.         _CompactMem:    OPWORD    $A04C
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION CompactMem
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal Size CompactMemSys(Size cbNeeded)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         ; parameters:
  518.         ;    cbNeeded        => D0
  519.         ; returns:
  520.         ;    Size            <= D0
  521.         _CompactMemSys:    OPWORD    $A44C
  522.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  523.         IMPORT_CFM_FUNCTION CompactMemSys
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal void PurgeMem(Size cbNeeded)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  530.         ; parameters:
  531.         ;    cbNeeded        => D0
  532.         _PurgeMem:    OPWORD    $A04D
  533.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  534.         IMPORT_CFM_FUNCTION PurgeMem
  535.     ENDIF
  536.  
  537. ;
  538. ; pascal void PurgeMemSys(Size cbNeeded)
  539. ;
  540.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  541.         ; parameters:
  542.         ;    cbNeeded        => D0
  543.         _PurgeMemSys:    OPWORD    $A44D
  544.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  545.         IMPORT_CFM_FUNCTION PurgeMemSys
  546.     ENDIF
  547.  
  548. ;
  549. ; pascal long FreeMem(void )
  550. ;
  551.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  552.         ; returns:
  553.         ;    long            <= D0
  554.         _FreeMem:    OPWORD    $A01C
  555.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  556.         IMPORT_CFM_FUNCTION FreeMem
  557.     ENDIF
  558.  
  559. ;
  560. ; pascal long FreeMemSys(void )
  561. ;
  562.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  563.         ; returns:
  564.         ;    long            <= D0
  565.         _FreeMemSys:    OPWORD    $A41C
  566.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  567.         IMPORT_CFM_FUNCTION FreeMemSys
  568.     ENDIF
  569.  
  570. ;
  571. ; pascal void ReserveMem(Size cbNeeded)
  572. ;
  573.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  574.         ; parameters:
  575.         ;    cbNeeded        => D0
  576.         _ReserveMem:    OPWORD    $A040
  577.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  578.         IMPORT_CFM_FUNCTION ReserveMem
  579.     ENDIF
  580.  
  581. ;
  582. ; pascal void ReserveMemSys(Size cbNeeded)
  583. ;
  584.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  585.         ; parameters:
  586.         ;    cbNeeded        => D0
  587.         _ReserveMemSys:    OPWORD    $A440
  588.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION ReserveMemSys
  590.     ENDIF
  591.  
  592. ;
  593. ; pascal Size MaxMem(Size *grow)
  594. ;
  595.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  596.         _MaxMem:    OPWORD    $A11D
  597.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION MaxMem
  599.     ENDIF
  600.  
  601. ;
  602. ; pascal Size MaxMemSys(Size *grow)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  605.         _MaxMemSys:    OPWORD    $A51D
  606.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  607.         IMPORT_CFM_FUNCTION MaxMemSys
  608.     ENDIF
  609.  
  610. ;
  611. ; pascal void SetGrowZone(GrowZoneUPP growZone)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  614.         ; parameters:
  615.         ;    growZone        => A0
  616.         _SetGrowZone:    OPWORD    $A04B
  617.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  618.         IMPORT_CFM_FUNCTION SetGrowZone
  619.     ENDIF
  620.  
  621. ;
  622. ; pascal void MoveHHi(Handle h)
  623. ;
  624.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  625.         ; parameters:
  626.         ;    h               => A0
  627.         _MoveHHi:    OPWORD    $A064
  628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  629.         IMPORT_CFM_FUNCTION MoveHHi
  630.     ENDIF
  631.  
  632. ;
  633. ; pascal void DisposePtr(Ptr p)
  634. ;
  635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  636.         ; parameters:
  637.         ;    p               => A0
  638.         _DisposePtr:    OPWORD    $A01F
  639.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  640.         IMPORT_CFM_FUNCTION DisposePtr
  641.     ENDIF
  642.  
  643. ;
  644. ; pascal Size GetPtrSize(Ptr p)
  645. ;
  646.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  647.         _GetPtrSize:    OPWORD    $A021
  648.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  649.         IMPORT_CFM_FUNCTION GetPtrSize
  650.     ENDIF
  651.  
  652. ;
  653. ; pascal void SetPtrSize(Ptr p, Size newSize)
  654. ;
  655.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  656.         ; parameters:
  657.         ;    p               => A0
  658.         ;    newSize         => D0
  659.         _SetPtrSize:    OPWORD    $A020
  660.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  661.         IMPORT_CFM_FUNCTION SetPtrSize
  662.     ENDIF
  663.  
  664. ;
  665. ; pascal void DisposeHandle(Handle h)
  666. ;
  667.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  668.         ; parameters:
  669.         ;    h               => A0
  670.         _DisposeHandle:    OPWORD    $A023
  671.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION DisposeHandle
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal void SetHandleSize(Handle h, Size newSize)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  679.         ; parameters:
  680.         ;    h               => A0
  681.         ;    newSize         => D0
  682.         _SetHandleSize:    OPWORD    $A024
  683.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  684.         IMPORT_CFM_FUNCTION SetHandleSize
  685.     ENDIF
  686.  
  687. ;  
  688. ;    NOTE
  689. ;    
  690. ;    GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  691. ;    in case of an error, but the traps actually return an error code in D0.
  692. ;    The glue sets D0 to 0 if an error occured.
  693. ;
  694.  
  695. ;
  696. ; pascal Size GetHandleSize(Handle h)
  697. ;
  698.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  699.         _GetHandleSize:    OPWORD    $A025
  700.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  701.         IMPORT_CFM_FUNCTION GetHandleSize
  702.     ENDIF
  703.  
  704. ;
  705. ; pascal Size InlineGetHandleSize(Handle h)
  706. ;
  707.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  708.         ; parameters:
  709.         ;    h               => A0
  710.         ; returns:
  711.         ;    Size            <= D0
  712.         _InlineGetHandleSize:    OPWORD    $A025
  713.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  714.         IMPORT_CFM_FUNCTION InlineGetHandleSize
  715.     ENDIF
  716.  
  717. ;
  718. ; pascal void ReallocateHandle(Handle h, Size byteCount)
  719. ;
  720.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  721.         ; parameters:
  722.         ;    h               => A0
  723.         ;    byteCount       => D0
  724.         _ReallocateHandle:    OPWORD    $A027
  725.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION ReallocateHandle
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal void ReallocateHandleSys(Handle h, Size byteCount)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  733.         ; parameters:
  734.         ;    h               => A0
  735.         ;    byteCount       => D0
  736.         _ReallocateHandleSys:    OPWORD    $A427
  737.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  738.         IMPORT_CFM_FUNCTION ReallocateHandleSys
  739.     ENDIF
  740.  
  741. ;
  742. ; pascal void EmptyHandle(Handle h)
  743. ;
  744.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  745.         ; parameters:
  746.         ;    h               => A0
  747.         _EmptyHandle:    OPWORD    $A02B
  748.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  749.         IMPORT_CFM_FUNCTION EmptyHandle
  750.     ENDIF
  751.  
  752. ;
  753. ; pascal void HSetRBit(Handle h)
  754. ;
  755.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  756.         ; parameters:
  757.         ;    h               => A0
  758.         _HSetRBit:    OPWORD    $A067
  759.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  760.         IMPORT_CFM_FUNCTION HSetRBit
  761.     ENDIF
  762.  
  763. ;
  764. ; pascal void HClrRBit(Handle h)
  765. ;
  766.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  767.         ; parameters:
  768.         ;    h               => A0
  769.         _HClrRBit:    OPWORD    $A068
  770.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  771.         IMPORT_CFM_FUNCTION HClrRBit
  772.     ENDIF
  773.  
  774. ;
  775. ; pascal SInt8 HGetState(Handle h)
  776. ;
  777.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  778.         ; parameters:
  779.         ;    h               => A0
  780.         ; returns:
  781.         ;    SInt8           <= D0
  782.         _HGetState:    OPWORD    $A069
  783.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  784.         IMPORT_CFM_FUNCTION HGetState
  785.     ENDIF
  786.  
  787. ;
  788. ; pascal void HSetState(Handle h, SInt8 flags)
  789. ;
  790.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  791.         ; parameters:
  792.         ;    h               => A0
  793.         ;    flags           => D0
  794.         _HSetState:    OPWORD    $A06A
  795.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  796.         IMPORT_CFM_FUNCTION HSetState
  797.     ENDIF
  798.  
  799. ;
  800. ; pascal void PurgeSpace(long *total, long *contig)
  801. ;
  802.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  803.         _PurgeSpace:    OPWORD    $A162
  804.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  805.         IMPORT_CFM_FUNCTION PurgeSpace
  806.     ENDIF
  807.  
  808.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  809. ;    PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  810. ;    on classic 68K.  The are the same as PurgeSpace() but return just
  811. ;    one value (either total space purgable or contiguous space purgable).
  812. ;
  813.  
  814. ;
  815. ; pascal long PurgeSpaceTotal(void )
  816. ;
  817.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  818.         ; returns:
  819.         ;    long            <= A0
  820.         _PurgeSpaceTotal:    OPWORD    $A062
  821.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  822.         IMPORT_CFM_FUNCTION PurgeSpaceTotal
  823.     ENDIF
  824.  
  825. ;
  826. ; pascal long PurgeSpaceContiguous(void )
  827. ;
  828.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  829.         ; returns:
  830.         ;    long            <= D0
  831.         _PurgeSpaceContiguous:    OPWORD    $A062
  832.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  833.         IMPORT_CFM_FUNCTION PurgeSpaceContiguous
  834.     ENDIF
  835.  
  836. ;
  837. ; pascal long PurgeSpaceSysTotal(void )
  838. ;
  839.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  840.         ; returns:
  841.         ;    long            <= A0
  842.         _PurgeSpaceSysTotal:    OPWORD    $A562
  843.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  844.         IMPORT_CFM_FUNCTION PurgeSpaceSysTotal
  845.     ENDIF
  846.  
  847. ;
  848. ; pascal long PurgeSpaceSysContiguous(void )
  849. ;
  850.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  851.         ; returns:
  852.         ;    long            <= D0
  853.         _PurgeSpaceSysContiguous:    OPWORD    $A562
  854.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  855.         IMPORT_CFM_FUNCTION PurgeSpaceSysContiguous
  856.     ENDIF
  857.  
  858.     ENDIF
  859. ; *****************************************************************************
  860. ;
  861. ;    The routines: 
  862. ;
  863. ;        BlockMoveUncached
  864. ;        BlockMoveDataUncached
  865. ;        BlockZero
  866. ;        BlockZeroUncached
  867. ;    
  868. ;    are intended for developers writing drivers. They do not exist in 
  869. ;    “InterfaceLib.” You must link with “DriverServicesLib” to access them.
  870. ;    
  871. ;    But since BlockMove and BlockMoveData exist in both “InterfaceLib” and
  872. ;    “DriverServicesLib”, you cannot link with both libraries.
  873. ;    
  874. ;****************************************************************************
  875.  
  876. ;
  877. ; pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
  878. ;
  879.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  880.         ; parameters:
  881.         ;    srcPtr          => A0
  882.         ;    destPtr         => A1
  883.         ;    byteCount       => D0
  884.         _BlockMove:    OPWORD    $A02E
  885.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  886.         IMPORT_CFM_FUNCTION BlockMove
  887.     ENDIF
  888.  
  889. ;
  890. ; pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
  891. ;
  892.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  893.         ; parameters:
  894.         ;    srcPtr          => A0
  895.         ;    destPtr         => A1
  896.         ;    byteCount       => D0
  897.         _BlockMoveData:    OPWORD    $A22E
  898.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  899.         IMPORT_CFM_FUNCTION BlockMoveData
  900.     ENDIF
  901.  
  902. ;
  903. ; extern void BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount)
  904. ;
  905.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  906.         IMPORT_CFM_FUNCTION BlockMoveUncached
  907.     ENDIF
  908.  
  909. ;
  910. ; extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount)
  911. ;
  912.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  913.         IMPORT_CFM_FUNCTION BlockMoveDataUncached
  914.     ENDIF
  915.  
  916. ;
  917. ; extern void BlockZero(void *destPtr, Size byteCount)
  918. ;
  919.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  920.         IMPORT_CFM_FUNCTION BlockZero
  921.     ENDIF
  922.  
  923. ;
  924. ; extern void BlockZeroUncached(void *destPtr, Size byteCount)
  925. ;
  926.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  927.         IMPORT_CFM_FUNCTION BlockZeroUncached
  928.     ENDIF
  929.  
  930.  
  931. ;
  932. ; pascal void MaxApplZone(void )
  933. ;
  934.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  935.         _MaxApplZone:    OPWORD    $A063
  936.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  937.         IMPORT_CFM_FUNCTION MaxApplZone
  938.     ENDIF
  939.  
  940. ;
  941. ; pascal void SetApplBase(void *startPtr)
  942. ;
  943.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  944.         ; parameters:
  945.         ;    startPtr        => A0
  946.         _SetApplBase:    OPWORD    $A057
  947.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  948.         IMPORT_CFM_FUNCTION SetApplBase
  949.     ENDIF
  950.  
  951. ;
  952. ; pascal void MoreMasters(void )
  953. ;
  954.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  955.         _MoreMasters:    OPWORD    $A036
  956.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  957.         IMPORT_CFM_FUNCTION MoreMasters
  958.     ENDIF
  959.  
  960. ;
  961. ; pascal void SetApplLimit(void *zoneLimit)
  962. ;
  963.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  964.         ; parameters:
  965.         ;    zoneLimit       => A0
  966.         _SetApplLimit:    OPWORD    $A02D
  967.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  968.         IMPORT_CFM_FUNCTION SetApplLimit
  969.     ENDIF
  970.  
  971.  
  972.  
  973. ;
  974. ; pascal void InitApplZone(void )
  975. ;
  976.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  977.         _InitApplZone:    OPWORD    $A02C
  978.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  979.         IMPORT_CFM_FUNCTION InitApplZone
  980.     ENDIF
  981.  
  982.  
  983. ;   Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  
  984. ;
  985. ; pascal void TempHLock(Handle h, OSErr *resultCode)
  986. ;
  987.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  988.         Macro
  989.         _TempHLock
  990.             move.w              #$001E,-(sp)
  991.             dc.w                $A88F
  992.         EndM
  993.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  994.         IMPORT_CFM_FUNCTION TempHLock
  995.     ENDIF
  996.  
  997. ;
  998. ; pascal void TempHUnlock(Handle h, OSErr *resultCode)
  999. ;
  1000.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1001.         Macro
  1002.         _TempHUnlock
  1003.             move.w              #$001F,-(sp)
  1004.             dc.w                $A88F
  1005.         EndM
  1006.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1007.         IMPORT_CFM_FUNCTION TempHUnlock
  1008.     ENDIF
  1009.  
  1010. ;
  1011. ; pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
  1012. ;
  1013.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1014.         Macro
  1015.         _TempDisposeHandle
  1016.             move.w              #$0020,-(sp)
  1017.             dc.w                $A88F
  1018.         EndM
  1019.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1020.         IMPORT_CFM_FUNCTION TempDisposeHandle
  1021.     ENDIF
  1022.  
  1023. ;
  1024. ; pascal Ptr TempTopMem(void )
  1025. ;
  1026.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1027.         Macro
  1028.         _TempTopMem
  1029.             move.w              #$0016,-(sp)
  1030.             dc.w                $A88F
  1031.         EndM
  1032.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1033.         IMPORT_CFM_FUNCTION TempTopMem
  1034.     ENDIF
  1035.  
  1036. ;
  1037. ; pascal OSErr HoldMemory(void *address, unsigned long count)
  1038. ;
  1039.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1040.         ; parameters:
  1041.         ;    address         => A0
  1042.         ;    count           => A1
  1043.         ; returns:
  1044.         ;    OSErr           <= D0
  1045.         Macro
  1046.         _HoldMemory
  1047.             moveq               #0,D0
  1048.             dc.w                $A05C
  1049.         EndM
  1050.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1051.         IMPORT_CFM_FUNCTION HoldMemory
  1052.     ENDIF
  1053.  
  1054. ;
  1055. ; pascal OSErr UnholdMemory(void *address, unsigned long count)
  1056. ;
  1057.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1058.         ; parameters:
  1059.         ;    address         => A0
  1060.         ;    count           => A1
  1061.         ; returns:
  1062.         ;    OSErr           <= D0
  1063.         Macro
  1064.         _UnholdMemory
  1065.             moveq               #1,D0
  1066.             dc.w                $A05C
  1067.         EndM
  1068.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1069.         IMPORT_CFM_FUNCTION UnholdMemory
  1070.     ENDIF
  1071.  
  1072. ;
  1073. ; pascal OSErr LockMemory(void *address, unsigned long count)
  1074. ;
  1075.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1076.         ; parameters:
  1077.         ;    address         => A0
  1078.         ;    count           => A1
  1079.         ; returns:
  1080.         ;    OSErr           <= D0
  1081.         Macro
  1082.         _LockMemory
  1083.             moveq               #2,D0
  1084.             dc.w                $A05C
  1085.         EndM
  1086.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1087.         IMPORT_CFM_FUNCTION LockMemory
  1088.     ENDIF
  1089.  
  1090. ;
  1091. ; pascal OSErr LockMemoryForOutput(void *address, unsigned long count)
  1092. ;
  1093.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1094.         ; parameters:
  1095.         ;    address         => A0
  1096.         ;    count           => A1
  1097.         ; returns:
  1098.         ;    OSErr           <= D0
  1099.         Macro
  1100.         _LockMemoryForOutput
  1101.             moveq               #10,D0
  1102.             dc.w                $A05C
  1103.         EndM
  1104.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1105.         IMPORT_CFM_FUNCTION LockMemoryForOutput
  1106.     ENDIF
  1107.  
  1108. ;
  1109. ; pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
  1110. ;
  1111.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1112.         ; parameters:
  1113.         ;    address         => A0
  1114.         ;    count           => A1
  1115.         ; returns:
  1116.         ;    OSErr           <= D0
  1117.         Macro
  1118.         _LockMemoryContiguous
  1119.             moveq               #4,D0
  1120.             dc.w                $A05C
  1121.         EndM
  1122.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1123.         IMPORT_CFM_FUNCTION LockMemoryContiguous
  1124.     ENDIF
  1125.  
  1126. ;
  1127. ; pascal OSErr UnlockMemory(void *address, unsigned long count)
  1128. ;
  1129.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1130.         ; parameters:
  1131.         ;    address         => A0
  1132.         ;    count           => A1
  1133.         ; returns:
  1134.         ;    OSErr           <= D0
  1135.         Macro
  1136.         _UnlockMemory
  1137.             moveq               #3,D0
  1138.             dc.w                $A05C
  1139.         EndM
  1140.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1141.         IMPORT_CFM_FUNCTION UnlockMemory
  1142.     ENDIF
  1143.  
  1144. ;
  1145. ; pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount)
  1146. ;
  1147.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1148.         Macro
  1149.         _GetPhysical
  1150.             moveq               #5,D0
  1151.             dc.w                $A05C
  1152.         EndM
  1153.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1154.         IMPORT_CFM_FUNCTION GetPhysical
  1155.     ENDIF
  1156.  
  1157. ;
  1158. ; pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
  1159. ;
  1160.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1161.         ; parameters:
  1162.         ;    userFunctionargument=> A0
  1163.         ;    argument        => D0
  1164.         ; returns:
  1165.         ;    OSErr           <= D0
  1166.         _DeferUserFn:    OPWORD    $A08F
  1167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1168.         IMPORT_CFM_FUNCTION DeferUserFn
  1169.     ENDIF
  1170.  
  1171. ;
  1172. ; pascal long DebuggerGetMax(void )
  1173. ;
  1174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1175.         ; returns:
  1176.         ;    long            <= D0
  1177.         Macro
  1178.         _DebuggerGetMax
  1179.             moveq               #0,D0
  1180.             dc.w                $A08D
  1181.         EndM
  1182.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1183.         IMPORT_CFM_FUNCTION DebuggerGetMax
  1184.     ENDIF
  1185.  
  1186. ;
  1187. ; pascal void DebuggerEnter(void )
  1188. ;
  1189.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1190.         Macro
  1191.         _DebuggerEnter
  1192.             moveq               #1,D0
  1193.             dc.w                $A08D
  1194.         EndM
  1195.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1196.         IMPORT_CFM_FUNCTION DebuggerEnter
  1197.     ENDIF
  1198.  
  1199. ;
  1200. ; pascal void DebuggerExit(void )
  1201. ;
  1202.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1203.         Macro
  1204.         _DebuggerExit
  1205.             moveq               #2,D0
  1206.             dc.w                $A08D
  1207.         EndM
  1208.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1209.         IMPORT_CFM_FUNCTION DebuggerExit
  1210.     ENDIF
  1211.  
  1212. ;
  1213. ; pascal void DebuggerPoll(void )
  1214. ;
  1215.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1216.         Macro
  1217.         _DebuggerPoll
  1218.             moveq               #3,D0
  1219.             dc.w                $A08D
  1220.         EndM
  1221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1222.         IMPORT_CFM_FUNCTION DebuggerPoll
  1223.     ENDIF
  1224.  
  1225. ;
  1226. ; pascal PageState GetPageState(const void *address)
  1227. ;
  1228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1229.         ; parameters:
  1230.         ;    address         => A0
  1231.         ; returns:
  1232.         ;    PageState       <= D0
  1233.         Macro
  1234.         _GetPageState
  1235.             moveq               #4,D0
  1236.             dc.w                $A08D
  1237.         EndM
  1238.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1239.         IMPORT_CFM_FUNCTION GetPageState
  1240.     ENDIF
  1241.  
  1242. ;
  1243. ; pascal Boolean PageFaultFatal(void )
  1244. ;
  1245.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1246.         ; returns:
  1247.         ;    Boolean         <= D0
  1248.         Macro
  1249.         _PageFaultFatal
  1250.             moveq               #5,D0
  1251.             dc.w                $A08D
  1252.         EndM
  1253.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1254.         IMPORT_CFM_FUNCTION PageFaultFatal
  1255.     ENDIF
  1256.  
  1257. ;
  1258. ; pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
  1259. ;
  1260.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1261.         ; parameters:
  1262.         ;    address         => A0
  1263.         ;    count           => A1
  1264.         ; returns:
  1265.         ;    OSErr           <= D0
  1266.         Macro
  1267.         _DebuggerLockMemory
  1268.             moveq               #6,D0
  1269.             dc.w                $A08D
  1270.         EndM
  1271.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1272.         IMPORT_CFM_FUNCTION DebuggerLockMemory
  1273.     ENDIF
  1274.  
  1275. ;
  1276. ; pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
  1277. ;
  1278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1279.         ; parameters:
  1280.         ;    address         => A0
  1281.         ;    count           => A1
  1282.         ; returns:
  1283.         ;    OSErr           <= D0
  1284.         Macro
  1285.         _DebuggerUnlockMemory
  1286.             moveq               #7,D0
  1287.             dc.w                $A08D
  1288.         EndM
  1289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1290.         IMPORT_CFM_FUNCTION DebuggerUnlockMemory
  1291.     ENDIF
  1292.  
  1293. ;
  1294. ; pascal StatusRegisterContents EnterSupervisorMode(void )
  1295. ;
  1296.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1297.         ; returns:
  1298.         ;    StatusRegisterContents <= D0
  1299.         Macro
  1300.         _EnterSupervisorMode
  1301.             moveq               #8,D0
  1302.             dc.w                $A08D
  1303.         EndM
  1304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1305.         IMPORT_CFM_FUNCTION EnterSupervisorMode
  1306.     ENDIF
  1307.  
  1308.  
  1309. ;  
  1310. ;    StripAddress and Translate24To32 are traps on classic 68K,
  1311. ;    but macro to the identity function on PowerMacs or other OS's.
  1312. ;
  1313.  
  1314. ;
  1315. ; pascal Ptr StripAddress(void *theAddress)
  1316. ;
  1317.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1318.         ; parameters:
  1319.         ;    theAddress      => D0
  1320.         ; returns:
  1321.         ;    Ptr             <= D0
  1322.         _StripAddress:    OPWORD    $A055
  1323.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1324.         IMPORT_CFM_FUNCTION StripAddress
  1325.     ENDIF
  1326.  
  1327.  
  1328. ;
  1329. ; pascal Ptr Translate24To32(void *addr24)
  1330. ;
  1331.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1332.         ; parameters:
  1333.         ;    addr24          => D0
  1334.         ; returns:
  1335.         ;    Ptr             <= D0
  1336.         _Translate24To32:    OPWORD    $A091
  1337.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1338.         IMPORT_CFM_FUNCTION Translate24To32
  1339.     ENDIF
  1340.  
  1341. ;
  1342. ; pascal OSErr HandToHand(Handle *theHndl)
  1343. ;
  1344.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1345.         _HandToHand:    OPWORD    $A9E1
  1346.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1347.         IMPORT_CFM_FUNCTION HandToHand
  1348.     ENDIF
  1349.  
  1350. ;
  1351. ; pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
  1352. ;
  1353.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1354.         ; parameters:
  1355.         ;    srcPtr          => A0
  1356.         ;    dstHndl         => A1
  1357.         ;    size            => D0
  1358.         ; returns:
  1359.         ;    OSErr           <= D0
  1360.         _PtrToXHand:    OPWORD    $A9E2
  1361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1362.         IMPORT_CFM_FUNCTION PtrToXHand
  1363.     ENDIF
  1364.  
  1365. ;
  1366. ; pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size)
  1367. ;
  1368.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1369.         _PtrToHand:    OPWORD    $A9E3
  1370.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1371.         IMPORT_CFM_FUNCTION PtrToHand
  1372.     ENDIF
  1373.  
  1374. ;
  1375. ; pascal OSErr HandAndHand(Handle hand1, Handle hand2)
  1376. ;
  1377.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1378.         ; parameters:
  1379.         ;    hand1           => A0
  1380.         ;    hand2           => A1
  1381.         ; returns:
  1382.         ;    OSErr           <= D0
  1383.         _HandAndHand:    OPWORD    $A9E4
  1384.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1385.         IMPORT_CFM_FUNCTION HandAndHand
  1386.     ENDIF
  1387.  
  1388. ;
  1389. ; pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
  1390. ;
  1391.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1392.         ; parameters:
  1393.         ;    ptr1            => A0
  1394.         ;    hand2           => A1
  1395.         ;    size            => D0
  1396.         ; returns:
  1397.         ;    OSErr           <= D0
  1398.         _PtrAndHand:    OPWORD    $A9EF
  1399.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1400.         IMPORT_CFM_FUNCTION PtrAndHand
  1401.     ENDIF
  1402.  
  1403.     IF OLDROUTINENAMES THEN
  1404.     ENDIF    ; OLDROUTINENAMES
  1405.     ENDIF ; __MACMEMORY__ 
  1406.  
  1407.